package ingress

// SSLCert describes a SSL certificate to be used in a server
type SSLCert struct {
	SSLProtocols string `json:"sslProtocols"`
	SSLCiphers   string `json:"sslCiphers"`
	// SSLCertificate contains the name of the SSLCertificate this was fetched from
	SSLCertificate string `json:"sslCertificate"`
}

// Equal tests for equality between two SSLCert types
func (c1 *SSLCert) Equal(c2 *SSLCert) bool {
	if c1 == c2 {
		return true
	}
	if c1 == nil || c2 == nil {
		return false
	}

	if c1.SSLProtocols != c2.SSLProtocols {
		return false
	}
	if c1.SSLCiphers != c2.SSLCiphers {
		return false
	}
	if c1.SSLCertificate != c2.SSLCertificate {
		return false
	}

	return true
}
